package com.sky.api.client;

import com.sky.entity.ShoppingCart;
import com.sky.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("cart-service")
public interface CartClient {
    @PostMapping("/user/shoppingCart/adds")
    @ApiOperation("批量添加购物车")
    void insertBatch(@RequestBody List<ShoppingCart> shoppingCartList);

    /**
     * 查看购物车
     * @return
     */
    @GetMapping("/user/shoppingCart/list")
    @ApiOperation("查看购物车")
    public Result<List<ShoppingCart>> list();

    /**
     * 清空购物车商品
     * @return
     */
    @DeleteMapping("/user/shoppingCart/clean")
    @ApiOperation("清空购物车商品")
    public Result<String> clean();
}
